home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HamCall (October 1991)
/
HamCall (Whitehall Publishing)(1991).bin
/
bcast
/
fccrf
/
amda1.bas
(
.txt
)
< prev
next >
Wrap
ST Writer Document
|
1990-10-14
|
10KB
|
241 lines
Do Run Run STWRITER.PRG
10 PRINT" 5. POLAR TO RECTANGULAR CONVERSION."
20 REM CLS
30 REM DAVE RILEY 8-87 AM DIRECTIONAL ARRAY HELPER
40 REM 11 WALNUT STREET MARSHFIELD, MA. 02050
50 REM RBBS 1200/2400 24/HRS 617-837-2880
60 PRINT:PRINT
70 PRINT TAB(10)"AM DIRECTIONAL ARRAY HELPER...DAVE RILEY...8-87"
80 PRINT TAB(10)"RBBS-DATA 1200/2400 BAUD 24/HRS 617-837-2880
90 PRINT:PRINT
100 PRINT" 1. T NETWORK 90 DEGREES, INPUT R1-R2"
110 PRINT" 2. T NETWORK OTHER THAN 90 DEGREES AND 50 OHMS IN/OUT"
120 PRINT" 3. T NETWORK OTHER THAN 90 DEGREES, INPUT R1-R2"
130 PRINT" 4. SERIES NETWORK PHASE ANGLE"
140 PRINT" 5. POLAR TO RECTANGULAR CONVERSION"
150 PRINT" 6. RECTANGULAR TO POLAR CONVERSION"
160 PRINT" 7. L/C RESONANT FREQUENCY"
170 PRINT" 8. SPACE PHASE"
180 PRINT" 9. RADIAL FIELD VECTORS"
190 PRINT
200 PRINT" X. >>>> RETURN TO DOS <<<<":PRINT:PRINT
210 PRINT" SELECT # ITEM ABOVE for COMPUTATION"
220 I$=INKEY$: IF I$="" THEN 220
230 REM select program start line
240 IF I$="1" THEN 440
250 IF I$="2" THEN 550
260 IF I$="3" THEN 690
270 IF I$="4" THEN 860
280 IF I$="5" THEN 1000
290 IF I$="6" THEN 1140
300 IF I$="7" THEN 1270
310 IF I$="8" THEN 1370
320 IF I$-"9" THEN 1770
330 IF I$="X" THEN SYSTEM
340 IF I$="x" THEN SYSTEM
350 GOTO 210
360 PRINT" RE-CALCULATE SAME ?"
370 PRINT
380 PRINT" Y=YES OR ANY OTHER KEY TO MENU"
390 C$=INKEY$ : IF C$="" THEN 390
400 IF C$="y" THEN RETURN
410 IF C$="Y" THEN RETURN
420 IF C$="X" THEN SYSTEM
430 GOTO 20
440 REM CLS : T Network where angle is 90 degrees and input R1 R2
450 REM X1=X2=X3=SQR(R1*R2)
460 PRINT : PRINT
470 PRINT" FOR A TEE NETWORK OF 90 DEGREES WITH:":PRINT
480 INPUT " INPUT R-Line";R1
490 INPUT " INPUT R-Load";R2
500 PRINT
510 X=SQR (R1*R2)
520 PRINT " X1=X2=X3=";X;"Ohms Reactive"
530 PRINT : PRINT
540 GOSUB 360 : PRINT:GOTO 440
550 REM CLS
560 PRINT:PRINT
570 REMBER T Network where angle other than 90 degrees, R1 R2 = 50 Ohms
580 PRINT:PRINT" FOR A TEE NETWORK OTHER THAN 90 DEGREES AND 50 OHMS IN/OUT"
590 PRINT
600 INPUT " INPUT Desired Phase Angle ";T:PRINT
610 F=.017453
620 R=F*T
630 X1=(50*(1-COS(R)))/(SIN(R))
640 X3=50/(SIN(R))
650 PRINT " Series X1=X2=";X1;"Ohms Reactive"
660 PRINT " Shunt X=";X3;"Ohms Reactive"
670 PRINT:PRINT
680 GOSUB 360 :PRINT:GOTO 550
690 REM CLS
700 REM T Network where angle is other than 90 degrees, input R1 R2
710 PRINT:PRINT
720 PRINT"TEE NETWORK WITH SHIFT OTHER THAN 90 DEGS. AND INPUT Rin/Rout":PRINT
730 INPUT " Phase Angle Desired";T
740 INPUT " Input Resistance";R1
750 INPUT " Output Resistance";R2
760 F=.017453:PRINT
770 R=F*T
780 X1=((SQR(R1*R2))*(1-((R1/R2)*COS(R))))/(SIN(R))
790 X2=((SQR(R1*R2))*(1-((R2
R1)*COS(R))))/(SIN(R))
800 X3=(SQR(R1*R2))/(SIN(R))
810 PRINT" X1=";X1
820 PRINT" X2=";X2
830 PRINT" X3=";X3
840 PRINT:PRINT
850 GOSUB 360 :PRINT:GOTO 690
860 PRINT:PRINTL:REM CLS TOO
870 REM SERIES NET Near 0 degree phase shift
880 REM Tan Theta = X/R = reactance/resistance
890 PRINT
900 PRINT" FOR A SERIES SHIFT NETWORK NEAR ZERO DEGREES:":PRINT
910 PRINT
920 INPUT" Resistance of Series Load";R1
930 INPUT" NET Reactance of Series Network";X
940 PRINT
950 T=-X/R1
960 D=((TAN(T))*57.3)
970 PRINT " Phase Angle =";D
980 PRINT:PRINT
990 GOSUB 360:PRINT:GOTO 860
1000 REM CLS
1010 REM DAVE RILEY MARSHFIELD, MASS. DATA 617-837-2880
1020 REM POLAR TO RECTANGULAR
1030 A=1.745329E-02:PRINT:PRINT:PRINT
1040 PRINT" POLAR INPUT TO RECTANGULAR OUTPUT:":PRINT
1050 INPUT" MAGNITUDE";L
1060 INPUT" ANGLE ";D
1070 PRINT
1080 X=(L*COS(D*A))
1090 Y=(L*SIN(D*A))
1100 PRINT " X= "USING "+###.##";X
1110 PRINT " Y= "USING "+###.##";Y
1120 PRINT:PRINT
1130 GOSUB 360:PRINT:GOTO 1000
1140 REM CLS
1150 REM DAVE RILEY MARSHFIELD, MASS. DATA 617-837-2880
1160 REM RECTANGULAR TO POLAR
1170 AA=57.29583:PRINT:PRINT
1180 PRINT" RECTANGULAR INPUT FOR POLAR OUTPUT:":PRINT
1190 INPUT" X VALUE ";X
1200 INPUT" Y VALUE ";Y
1210 M=SQR((X*X)+(Y*Y))
1220 D=(ATN(Y/X))*AA
1230 PRINT
1240 PRINT " MAGNITUDE = "USING "+##.#";M
1250 PRINT " ANGLE = "USING "+###.#";D
1260 PRINT:GOSUB 360:PRINT:GOTO 1140
1270 PRINT:PRINT:REM CLS
1280 REM DAVE RILEY MARSHFIELD, MASS. DATA 617-837-2880
1290 REM RESONANT FREQUENCY OF L AND C
1300 INPUT " INDUCTANCE IN MICROHENRIES";L
1310 INPUT " CAPACITANCE IN PICOFARADS ";C
1320 F=1/(6.28318*(SQR(L*C)))
1330 PRINT
1340 PRINT" FREQUENCY IN MHZ ="USING "###.##";F/.001
1350 PRINT
1360 GOSUB 360:PRINT:GOTO 1270
1370 REM CLS
1380 REM DAVE RILEY MARSHFIELD, MASS. DATA 617-837-2880
1390 REM SPACE PHASE ROUTINE UP TO FOUR TOWERS
1400 REM CHANGE LINES STARTING WITH SA= SB= ETC. TO YOUR OWN PARAMETERS
1410 REM FIRST NUMBER IS DISTANCE IN DEGREES FROM REFERENCE CENTER OF ARRAY TO
1420 REM TOWER. SECOND NUMBER ON LINE IS AZIMUTH FROM CENTER REFERENCE THROUGH
1430 REM THAT TOWER. SA=TOWER #1 SB=TOWER #2 ETC.
1440 KA=.017453: KB=57.29583:REM RADIAN/DEGREE CONVERSIONS
1450 PRINT:PRINT:PRINT
1460 INPUT " TOWER #1 PHASE";A
1470 INPUT " TOWER #2 PHASE";B
1480 INPUT " TOWER #3 PHASE";C
1490 INPUT " TOWER #4 PHASE";D:PRINT
1500 INPUT " TOWER #1 FIELD";E
1510 INPUT " TOWER #2 FIELD";F
1520 INPUT " TOWER #3 FIELD";G
1530 INPUT " TOWER #4 FIELD";H
1540 PRINT:PRINT
1550 INPUT " MONITOR POINT RADIAL";M:REM CLS HERE
1560 SA=((150*KA)*COS((130-M)*KA))*KB:REM 150=DEGREES SPACE FROM ARRAY CENTER
1570 SB=((50*KA)*COS((130-M)*KA))*KB:REM 130=DEGREES HEAD FROM CENTER-TOWER
1580 SC=((50*KA)*COS((310-M)*KA))*KB
1590 SD=((150*KA)*COS((310-M)*KA))*KB
1600 PRINT" MONITOR RADIAL "M" DEGREES"
1610 PRINT" ------------------------------":PRINT
1620 PRINT"TOWER PHASE "USING "+###.# "; A;B;C;D
1630 PRINT"SPACE PHASE "USING "+###.# "; SA;SB;SC;SD
1640 VA=SA+A : VB=SB+B : VC=SC+C : VD=SD+D
1650 PRINT"VECTOR PHASE "USING "+###.# "; VA;VB;VC;VD
1660 PRINT"VECTOR LENGTH "USING "##.### "; E;F;G;H
1670 REM POLAR TO RECT. CONVERSION X4
1680 XA=E*(COS(VA*KA)):YA=E*(SIN(VA*KA))
1690 XB=F*(COS(VB*KA)):YB=F*(SIN(VB*KA))
1700 XC=G*(COS(VC*KA)):YC=G*(SIN(VC*KA))
1710 XD=H*(COS(VD*KA)):YD=H*(SIN(VD*KA))
1720 XT=XA+XB+XC+XD:YT=YA+YB+YC+YD:REM ADD VECTORS
1730 MA=SQR((XT*XT)+(YT*YT))
1740 PRINT:PRINT "POLAR INPUT VECTOR LENGTH";MA
1750 PRINT:PRINT
1760 GOSUB 360:PRINT:GOTO 1370
1770 REM CLS
1780 REM DAVE RILEY MARSHFIELD, MASS. DATA 617-837-2880
1790 REM LINE PRINTER OUTPUT OF SPACE VECTORS BETWEEN ANY TWO RADIAL HEADINGS
1800 REM SET 'M' IN FOR M= ? TO ? STEP WHATEVER AMOUNT OF DEGREES
1810 REM RE-MAKE LINES WITH SA= SB= ETC FOR YOUR OWN PARAMETERS WHERE FIRST
1820 REM NUMBER IS DISTANCE IN DEGREES FROM ARRAY CENTER TO TOWER #.
1830 REM SECOND NUMBER IN LINE IS AZIMUTH HEADING FROM CENTR ARRAY THROUGH
1840 REM TOWER #.
1850 KA=.017453 : KB=57.29583 :REM RADIAN/DEGREE CONVERSION
1860 PRINT:PRINT:PRINT
1870 PRINT" LINE PRINTER OUTPUT OF MONITOR RADIAL AND FIELD":PRINT
1880 INPUT " TOWER #1 PHASE";A
1890 INPUT " TOWER #2 PHASE";B
1900 INPUT " TOWER #3 PHASE";C
1910 INPUT " TOWER #4 PHASE";D
1920 PRINT
1930 INPUT " TOWER #1 FIELD";E
1940 INPUT " TOWER #2 FIELD";F
1950 INPUT " TOWER #3 FIELD";G
1960 INPUT " TOWER #4 FIELD";H
1970 LPRINT:LPRINT
1980 LPRINT A"/"E
1990 LPRINT B"/"F
2000 LPRINT C"/"G
2010 LPRINT D"/"H
2020 LPRINT
2030 LPRINT "RADIAL - FIELD"
2040 FOR M=0 TO 359 STEP 10 :REM SET START AND STOP OF RUN PLUS INCREMENT
2050 SA=((150*KA)*COS((130-M)*KA))*KB:REM 150 IS DIST IN DEGREES FROM CENTER
2060 SB=((50*KA)*COS((130-M)*KA))*KB:REM 130 IS HEADING FROM CENTER TO TOWER
2070 SC=((50*KA)*COS((310-M)*KA))*KB
2080 SD=((150*KA)*COS((310-M)*KA))*KB
2090 VA=SA+A : VB=SB+B : VC=SC+C : VD=SD+D
2100 XA=E*(COS(VA*KA)):YA=E*(SIN(VA*KA))
2110 XB=F*(COS(VB*KA)):YB=F*(SIN(VB*KA))
2120 XC=G*(COS(VC*KA)):YC=G*(SIN(VC*KA))
2130 XD=H*(COS(VD*KA)):YD=H*(SIN(VD*KA))
2140 XT=XA+XB+XC+XD:YT=YA+YB+YC+YD
2150 MA=SQR((XT*XT)+(YT*YT))
2160 LPRINT USING "###.###";M,MA
2170 NEXT M
2180 PRINT:PRINT:PRINT:PRINT
2190 PRINT " WANT TO RE-RUN WITH A CHANGED INPUT ?"
2200 PRINT " TYPE Y FOR YES ELSE ANY KEY FOR MAIN MENU"
2210 PRINT:PRINT
2220 R$=INKEY$:IF R$="" THEN 2220
2230 IF R$="Y" THEN 2270
2240 IF R$="y" THEN 2270
2250 GOTO 20
2260 PRINT:PRINT
2270 PRINT" CHANGE ANY A THROUGH H VALUE TO DESIRED PARAMETER."
2280 PRINT" AFTER BASIC 'OK' PROMPT TYPE LIKE 'A=-140'and (ENTER)."
2290 PRINT" AFTER SECOND BASIC PROMPT, TYPE 'CONT' and (ENTER).
2300 PRINT:PRINT
2310 STOP
2320 GOTO 1970
3000 REM SYSOP HELPS:
3010 REM INPLACE OF INKEY YOU MAY HAVE TO USE INPUT FOR
3020 REM NUMERIC AND ADD INPUT R$:R$=LEFT$(R$,1) IN LINE 2220
3030 REM INPLACE OF R$=INKEY$....DEPENDS ON YOUR BASIC THIS WAS
3040 REM DONE IN GW BASIC (ONE OF THE IBM-ONLY BASICS THAT IS
3050 REM PRETTY MUCH TRANSPORTABLE).